/**
  * Author: Mei
  * Date: 2020-12-13 15:11
  * Description:
  *
  *
  */
#include "../head.h"

using namespace std;

int main() {
    cout << sizeof(string) << endl;
    cout << sizeof(int) << endl;
    cout << sizeof(complex<double>) << endl;

    tuple<string, int, int, complex<double>> t;
    cout << "sizeof = " << sizeof(t) << endl;
    tuple<string, int, int> t1 = {"abc", 32, 22};
    cout << "get<0>: " << get<0>(t1) << endl;

    auto t3 = make_tuple("12", 12, "add");
    cout << "get<2>: " << get<2>(t3) << endl;

    tuple<string, int, int> t4 = {"abc", 32, 22};
    string a;
    int b;
    int c;
    tie(a, b, c) = t4;  //与tuple捆绑在一起
    cout << "a = " << a << ", b = " << b << ", c = " << c << endl;

    //meta programming  对变量做操作
    typedef tuple<string, int, int, string> TupleType;
    cout << "tuple_size: " << tuple_size<TupleType>::value << endl;
    tuple_element<1, TupleType>::type f1 = 20;
    cout << "tuple_element: " << f1 << endl;

    return 0;
}